<?php

namespace App\Providers;

use Illuminate\Support\ServiceProvider;

class ConfigServiceProvider extends ServiceProvider
{
    /**
     * Register services.
     *
     * @return void
     */
    public function register()
    {
        //
    }

    /**
     * Bootstrap services.
     *
     * @return void
     */
    public function boot()
    {
        //
//        $this->loadConfig();
//        dump(config('filesystems.disks'));
    }


    public function loadConfig(){
        $config = [
            'cosv5' => [
                'driver' => 'cosv5',
                'region'          => env('COSV5_REGION', 'ap-guangzhou'),
                'credentials'     => [
                    'appId'     => env('COSV5_APP_ID'),
                    'secretId'  => env('COSV5_SECRET_ID'),
                    'secretKey' => env('COSV5_SECRET_KEY'),
                ],
                'timeout'         => env('COSV5_TIMEOUT', 60),
                'connect_timeout' => env('COSV5_CONNECT_TIMEOUT', 60),
                'bucket'          => env('COSV5_BUCKET'),
                'cdn'             => env('COSV5_CDN'),
                'scheme'          => env('COSV5_SCHEME', 'https'),
                'read_from_cdn'   => env('COSV5_READ_FROM_CDN', false),
            ],
        ];

        config(['filesystems.disks'=>array_merge(config('filesystems.disks'),$config)]);
    }
}
